<HTML>
<HEAD>
  <!-- Created with AOLpress/2.0 -->
  <!-- AP: Created on: 14-Jan-2002 -->
  <!-- AP: Last modified: 22-Aug-2008 -->
  <TITLE>Command Line Arguments</TITLE>
  <LINK REL="icon" href="fftype16.png">
  <LINK REL="stylesheet" TYPE="text/css" HREF="FontForge.css">
</HEAD>
<BODY>
<DIV id="in">
  <H1 ALIGN=Center>
    Command Line Arguments
  </H1>
  <BLOCKQUOTE>
    <PRE>$ fontforge [-options] [filenames]
$ fontforge [-script] scriptfile [arguments]
$ fontforge -c script-string [arguments]
</PRE>
  </BLOCKQUOTE>
  <P>
  The filenames may specify any number of files in one of the font formats
  that FontForge recognizes (various postscript formats, truetype, opentype,
  mac resource, bitmap, svg, etc.).
  <P>
  Some files (.ttc or mac resource) may contain more than one outline font.
  You may pick which font you want by following the filename with the fontname
  in parentheses, thus:<BR>
  <BLOCKQUOTE>
    <PRE>$ fontforge "gulim.ttc(GulimChe)"
</PRE>
  </BLOCKQUOTE>
  <P>
  will select the font GulimChe out of the font file gulim.ttc.
  <P>
  FontForge recognizes the following options:
  <DL>
    <DT>
      -allglyphs
    <DD>
      Load all glyphs from the 'glyf' table of a ttc file, rather than the subset
      used in the selected font. (Note that if a ttc file contains multiple 'glyf'
      tables, only one will be loaded, but that one will be completely loaded).
    <DT>
      -c script-string
    <DD>
      If FontForge's first (or second, if the first is -lang) argument is "-c"
      then the argument that follows will be treated as a string containing scripting
      commands, and those commands will be executed. All remaining arguments will
      be passed to the script.
      <BLOCKQUOTE>
	<PRE>$ fontforge -c 'Open($1); Generate($2)' foo.sfd foo.ttf
</PRE>
      </BLOCKQUOTE>
      <P>
      Will read a font from "foo.sfd" and then generate a truetype font from it
      called "foo.ttf"
    <DT>
      -cmap type
    <DD>
      Where type may be<BR>
      &nbsp; &nbsp; Current | Copy | Private<BR>
      Gives the user some control over <A HREF="xres.html#Colormap">colormap handling
      </A>on 8bit screens.
    <DT>
      -depth val
    <DD>
      Specifies that FontForge should search for a visual with the given depth
    <DT>
      -display name
    <DD>
      Specifies the name of the display on which FontForge will open its windows
    <DT>
      -dontopenxdevices
    <DD>
      Various people have complained that when FontForge attempts to open the devices
      of the wacom graphics tablet, the X server gives a BadDevice error. I can't
      duplicate this, the open works fine on my system, but this argument allows
      them to tell fontforge not to try to use the tablet.
    <DT>
      -help
    <DD>
      Bring up a <A HREF="helpmenu.html">browser</A> looking at this documentation.
    <DT>
      -lang={py|ff}<BR>
      -lang {py|ff}
    <DD>
      Specifies whether the script should be interpretted as a python script or
      a fontforge script.
    <DT>
      -version
    <DD>
      Prints out the source version and exits.
    <DT>
      -keyboard type
    <DD>
      Where type may be<BR>
      &nbsp; &nbsp; ibm | mac | sun | ppc | 0 | 1 | 2 | 3<BR>
      Allows you to specify the type of keyboard. Currently this is only relevent
      when generating menus. The modifier keys are in different locations on different
      keyboards (under different operating systems) and if FontForge knows what
      keyboard you are using it can make the hot-keys have better labels.
      <UL>
	<LI>
	  ibm | 0<BR>
	  Uses the Control and Alt keys
	<LI>
	  mac | 1<BR>
	  Uses the Control and Option keys (Mac OS/X, Mac keyboard)
	<LI>
	  ppc | 3<BR>
	  Uses the Control and Command keys (Suse ppc linux, Mac keyboard)
	<LI>
	  sun | 2<BR>
	  Uses the Control and Meta keys
      </UL>
    <DT>
      -last
    <DD>
      Opens the last sfd file closed. If used more than once will open the last
      several sfd files.
    <DT>
      -library-status
    <DD>
      Writes info about the status of optional libraries to stderr. Including:
      Whether the library exists on this system, whether ff can use it, and an
      URL from which the library can be found.
    <DT>
      -new
    <DD>
      Creates a new font.
    <DT>
      -nosplash
    <DD>
      FontForge will not display its splash screen on startup (for slow connections)
    <DT>
      -open
    <DD>
      Bring up an open font dialog
    <DT>
      -quit
    <DD>
      Exit fontforge (only useful if -unique is passed as well, in which case the
      master fontforge will be asked to exit)
    <DT>
      -recover type
    <DD>
      Where type may be:
      <DL>
	<DT>
	  none
	<DD>
	  Do not attempt any automatic file recovery
	<DT>
	  clean
	<DD>
	  Clean out the directory containing files to be recovered
	<DT>
	  auto
	<DD>
	  recover any files which have been changed but which fontforge crashed on
	  before saving.
      </DL>
    <DT>
      -<A NAME="script">script</A> script-file
    <DD>
      If FontForge's first argument is "-script" then the argument that follows
      will be treated as a <A HREF="scripting.html">script file</A> and all the
      remaining arguments will be passed as arguments to that file. (The "-script"
      argument may be omitted, and if the first argument is an executable file
      which whose first line starts with "#!" and contains "fontforge". This means
      that fontforge may be used as an interpreter. Ie. you can create a fontforge
      script file and type its name to your shell and fontforge will be invoked
      to process that file as a script file (passing any arguments to it)).
    <DT>
      -sync
    <DD>
      Do synchronous screen drawing. Slows things down, makes some things easier
      to debug.
    <DT>
      -unique
    <DD>
      If there is already a fontforge running on this screen, then the current
      version will pass its arguments to the already existing one for it to open,
      and then the current version will exit. So it looks more like a Mac/Windows
      app.
    <DT>
      -usage
    <DD>
      Display a brief description of the options
    <DT>
      -vc type
    <DD>
      Where type may be:<BR>
      StaticGray GrayScale StaticColor PsuedoColor TrueColor DirectColor<BR>
      (See the X manuals for a description of what these mean). FontForge will
      search through the visuals in an attempt to find one with the desired VisualClass
      (given here) and depth (given with the -depth option).
  </DL>
  <H2>
    <A NAME="Environment">Environment Variables</A>
  </H2>
  <P>
  FontForge examines the following environment variables:
  <DL>
    <DT>
      <CODE><A NAME="BROWSER">BROWSER</A></CODE>
    <DD>
      Specifies the name of a browser program for examining documentation (must
      be able to read a local or remote html file and display it reasonably). On
      CygWin systems browsers that work in the windows world (as opposed to the
      cygwin sub-system) must be specified by a full path spec.
    <DT>
      <CODE><A NAME="AUTOTRACE">AUTOTRACE</A></CODE>
    <DD>
      Specifies the name and location of the autotrace program. (if not specified
      FontForge will try to find it in the user's path)
    <DT>
      <CODE>POTRACE</CODE>
    <DD>
      Specifies the name and location of the potrace program.
    <DT>
      <CODE><A NAME="MF">MF</A></CODE>
    <DD>
      Specifies the name and location of the metafont program. (if not specified
      FontForge will try to find it in the user's path)
    <DT>
      <CODE>FONTFORGE_VERBOSE</CODE>
    <DD>
      Turns on verbose mode in script execution (the script will be printed to
      stdout as it is executed).
    <DT>
      <CODE>FONTFORGE_LOADPREFS</CODE>
    <DD>
      Controls loading of preference items. If set to "Always" then preferences
      will be loaded even for scripts. If set to "Never" then preferences will
      not be loaded unless explicitly requested. If unset (or if set to any other
      value) then preferences will be loaded when ff starts up with a user interface,
      and will not be loaded if ff starts up executing a script.
    <DT>
      <CODE>FONTFORGE_LANGUAGE</CODE>
    <DD>
      Provides a default interpreter to use when executing a script. Must be either
      "py" or "ff"/"pe".
  </DL>
  <P>
    <HR>
  <DL>
    <DT>
      <CODE>LANG, LC_ALL, </CODE>etc.
    <DD>
      To determine the current locale, etc.
    <DT>
      <CODE>PATH</CODE>
    <DD>
      Used when looking for Autotrace or mf programs
    <DT>
      <CODE>TMPDIR</CODE>
    <DD>
      Temporary directory. Used for temporary files for which I need a filename
      (ie. to pass to autotrace, etc.)
    <DT>
      <CODE>HOME</CODE>
    <DD>
      Used to figure out where to put the .FontForge directory which includes user
      preferences and the recovery files.
    <DT>
      <CODE>USER</CODE>
    <DD>
      Used to create comments in new fonts about who created the font, or who saved
      it.
  </DL>
  <P>
  <P>
  <P ALIGN=Center>
  -- <A HREF="xres.html">Prev</A> -- <A HREF="overview.html">TOC</A> --
  <A HREF="files.html">Next</A> --
</DIV>
</BODY></HTML>
